package com.dcy.daily.common.enums;

/**
 * 响应码，返回前端
 * @author duanchunyu
 * @version 1.0.0
 * @createTime 2021年11月03日 15:34
 */
public enum ResponseCodeEnum {
    SUCCESS("200","SUCCESS"),
    FAIL("500","FAIL"),

    EXCEPTION("B0001", "系统异常!"),

    OBJECT_TO_JSON_ERROR("J001","Object转json字符串异常!"),
    JSON_TO_POJO_ERROR("J002","json字符串转java对象异常!"),
    JSON_TO_MAP_ERROR("J003","json字符串转map异常!"),
    MAP_TO_JSON_ERROR("J004","map转json字符串异常!"),
    JSON_TO_LIST_ERROR("J005","json字符串转list异常!"),
    JSON_GET_FIELD_ERROR("J006","json字符串获取字段异常!"),
    OBJECT_TO_POJO_ERROR("J007","Object转POJO对象异常!"),
    OBJECT_TO_BYTE_ERROR("J008","Object转BYTE异常!"),


    PARAM_VALID_FAILED("V0004", "参数校验失败!"),
    ;
    private String code;

    private String desc;

    ResponseCodeEnum(String code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return this.getCode();
    }
}
